package com.example.keli.ui.my.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.keli.R;
import com.example.keli.base.adapter.RecyclerAdapter;
import com.example.keli.base.adapter.RecyclerViewHolder;
import com.example.keli.ui.my.model.CommissionVO;
import com.example.keli.ui.my.model.StarVO;

import java.util.List;

/**
 * description $desc$
 * created by jerry on 2019/3/18.
 */
public class StarAdapter extends BaseQuickAdapter<StarVO, BaseViewHolder> {

    private int mType = 0;//0 被点赞   1我点赞的

    public StarAdapter(List<StarVO> mData, Context context, int type) {
        super(R.layout.item_info_common, mData);
        this.mType = type;
    }

    @Override
    protected void convert(BaseViewHolder hepler, StarVO starVO) {
//        TextView num = hepler.getView(R.id.tv_star_num);
        TextView name = hepler.getView(R.id.tv_name);
        ImageView imageView = hepler.getView(R.id.iv_avatar);

        if (mType == 0){
            Glide.with(mContext).load(starVO.getAvatar()).into(imageView);
            name.setText(starVO.getNickname());
        }else {
            Glide.with(mContext).load(starVO.getBy_avatar()).into(imageView);
            name.setText(starVO.getBy_nickname());
        }
    }
}
